#
# Makefile for CS181 Clustering
# Do not modify unless you add more source files.
#
# Please note that we use the g++ compiler to take 
# advantage of some C++ features such as streams.
# Feel free to use any C++ features you wish.

SUBMIT   = /usr/local/bin/submit
SOURCES  = clust.c clust_util.c
HEADERS  = clust_util.h
OBJECTS  = $(SOURCES:.c=.o)
RESULT   = clust

CC = g++
CFLAGS = -g -O -Wall -ansi -pedantic
RM = rm -f

.SUFFIXES:
.SUFFIXES: .c .o

$(RESULT): $(OBJECTS)
	$(CC) -o $@ $(OBJECTS)

.c.o:
	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<

clean:
	$(RM) $(RESULT) *.o *.core core *~

submit: $(RESULT)
	$(RM) $(RESULT) *.o *.core core *~
	$(SUBMIT) cs181 4 `pwd`

clust_util.o: clust_util.c clust_util.h
clust.o: clust.c clust_util.h
